import request from '@/utils/request'

export function listBrand(query) {
  return request({
    url: '/brand/list',
    method: 'get',
    params: query
  })
}

export function createBrand(data) {
  return request({
    url: '/brand/create',
    method: 'post',
    data
  })
}

export function readBrand(data) {
  return request({
    url: '/brand/read',
    method: 'get',
    data
  })
}

export function updateBrand(data) {
  return request({
    url: '/brand/update',
    method: 'post',
    data
  })
}

export function deleteBrand(data) {
  return request({
    url: '/brand/delete',
    method: 'post',
    data
  })
}
// 设备分布
export function listMap() {
  return request({
    url: '/map/findAll',
    method: 'get'
  })
}
// 所有设备
export function listDev(query) {
  return request({
    url: '/devInfo/findAll',
    method: 'get',
    params: query
  })
}
// 新增设备
export function createDev(data) {
  return request({
    url: '/devInfo/add',
    method: 'post',
    data
  })
}
// 更新设备
export function updateDev(data) {
  return request({
    url: '/devInfo/update',
    method: 'post',
    data
  })
}
// 删除设备
export function deleteDev(row) {
  return request({
    url: `/devInfo/delete/${row.id}`,
    method: 'delete'
  })
}

